<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript">
	$(document).ready(function(){
		$("#loginForAdminBtn").click(function(){
			if($("#adminid").val()==""){
				alert("아이디를 입력하세요");
				return false;
			}
			if($("#password").val()==""){
				alert("패스워드를 입력하세요");
				return false;
			}
			$("#loginForAdminForm").submit();
		});//loginform submit
		$("input[name=adminid]").click(function(){
			$(this).val("");
		});
		$("input[name=password]").click(function(){
			$(this).val("");
		});
	});//ready
</script>
<table style="border-width: thin;" bordercolor="lightgrey">
<tr>
<td width="188">
<font size="3">관리자 로그인</font>
<c:choose>
	<c:when test="${sessionScope.admin==null}">
		<div>
			<form id="loginForAdminForm" method="post" action="loginForAdmin.do">
			<table>
				<tr>
				<td><font size="2">아이디</font></td>
				</tr>
				<tr>
				<td><input type="text" name="adminid" id="adminid" value="아이디"></td>
				</tr>
				<tr>
				<td><font size="2">패스워드</font></td>
				</tr>
				<tr>
				<td><input type="password" name="password" id="password" value="패스워드"></td>
				</tr>
				<tr>
				<td><input type="button" value="로그인" id="loginForAdminBtn"></td>
				</tr>
			</table>
			</form>
		</div>
	</c:when>
	<c:otherwise>
		<form action="logoutForAdmin.do" name="logoutForm" method="post">
			${sessionScope.admin.name } 님<br>
			로그인 하였습니다. <input type="submit" value="로그아웃">
		</form>
	</c:otherwise>
</c:choose>
</td>
</tr>
</table>